<head>
  <!-- JQuery -->
  <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
  <!-- Bootstrap -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"/>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
  <!-- Chosen Dropdown Library -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.css"/>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.4.2/chosen.jquery.min.js"></script>
  <!-- Brat -->
  <link rel="stylesheet" type="text/css" href="https://nlp.stanford.edu/js/brat/style-vis.css"/>
  <script type="text/javascript" src="https://nlp.stanford.edu/js/brat/client/lib/head.load.min.js"></script>
  <!-- d3 -->
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
  <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/dagre-d3/0.4.17/dagre-d3.min.js"></script>

    <!-- CoreNLP -->
  <link rel="stylesheet" type="text/css" href="corenlp-brat.css"/>
  <script type="text/javascript" src="corenlp-brat.js"></script>

  <meta charset="UTF-8">
</head>

<body>
<div id="wrap">
<!-- A header bar -->
<nav class="navbar navbar-default navbar-static-top">
  <div class="container">
    <div class="navbar-header">
      <a class="navbar-brand" href="https://nlp.stanford.edu/software/corenlp.shtml">Stanford CoreNLP</a>
    </div>
  </div>
</nav>

<!-- The main content of the page -->
<div class="container">
  <div class="row">

    <!-- Text area input -->
    <form id="form_annotate" accept-charset="UTF-8" onsubmit="return false;">
    <div class="col-sm-12" style="margin-bottom: 5px;">
      <label for="text" class="label">&mdash; Text to annotate &mdash;</label>
      <textarea class="form-control" rows="2" id="text" placeholder="e.g., The quick brown fox jumped over the lazy dog." autofocus></textarea>
    </div>

    <!-- Annotators select -->
    <div class="col-sm-8">
      <label for="annotators" class="label">&mdash; Annotations &mdash;</label>
      <select id="annotators" data-placeholder="CoreNLP annotators"
              multiple class="chosen-select" title="Select CoreNLP annotators">
        <option value="pos"            selected > parts-of-speech    </option>
        <option value="lemma"                   > lemmas             </option>
        <option value="ner"            selected > named entities     </option>
        <option value="regexner"                > named entities (regexner)</option>
        <option value="parse"                   > constituency parse </option>
        <option value="depparse"       selected > dependency parse   </option>
        <option value="openie"         selected > openie             </option>
        <option value="coref"                   > coreference        </option>
        <option value="entitylink"              > wikipedia entities </option>
        <option value="kbp"                     > relations          </option>
        <option value="sentiment"               > sentiment          </option>
      </select>
    </div>

    <div class="col-sm-2">
        <label for="language" class="label">&mdash; Language &mdash;</label>
        <select id="language" data-placeholder="Language"
                class="chosen-select" title="Language">
            <option value="ar"                 > Arabic    </option>
            <option value="zh"                 > Chinese   </option>
            <option value="en"        selected > English   </option>
            <option value="fr"                 > French    </option>
            <option value="de"                 > German    </option>
            <option value="es"                 > Spanish   </option>
        </select>
    </div>

    <!-- Submit button -->
    <div class="col-sm-2" style="text-align: center; margin-top: 7px; ">
        <button id="submit" class="btn btn-block">Submit</button>
    </div>
    </form>

  </div>
  <div class="row">
    <!-- A panel for errors to show up in -->
    <div id="errors" class="row">
    </div>

    <!-- Loading gif -->
    <div id="loading" class="row" style="display:none">
      <img src="//storage.googleapis.com/corenlp/loading.gif" height="100px" style="margin-left: 100px"/>
    </div>

    <!-- Annotation population area -->
    <div id="annotations" class="row" style="display:none">
    </div>
  </div>


  <!-- Patterns -->
  <div id="patterns_row" class="row" hidden>
    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
      <li class="active"><a href="#div_tokensregex" role="tab" data-toggle="tab">TokensRegex</a></li>
      <li               ><a href="#div_semgrex"     role="tab" data-toggle="tab">Semgrex</a></li>
      <li               ><a href="#div_tregex"      role="tab" data-toggle="tab">Tregex</a></li>
    </ul>

    <!-- Tab panes -->
    <div id="div_patterns" class="tab-content">

      <!-- TokensRegex -->
      <div class="tab-pane active pattern_tab" id="div_tokensregex">
        <form id="form_tokensregex" accept-charset="UTF-8">
        <label for="tokensregex_search">Enter a <a href="http://nlp.stanford.edu/software/tokensregex.shtml">TokensRegex</a>
          expression to run against the above sentence:</label>
        <div class="input-group">
          <input id="tokensregex_search" type="text" class="form-control" placeholder='e.g., (?$foxtype [{pos:JJ}]+ ) fox'/>
          <span class="input-group-btn">
            <input id="button_tokensregex" class="btn btn-default" type="submit" value="Match"/>
          </span>
        </div>
        </form>
      </div>

      <!-- Semgrex -->
      <div class="tab-pane pattern_tab" id="div_semgrex">
        <form id="form_semgrex" accept-charset="UTF-8">
        <label for="semgrex_search">Enter a <a href="http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/semgraph/semgrex/SemgrexPattern.html">Semgrex</a>
          expression to run against the "enhanced dependencies" above:</label>
        <div class="input-group">
          <input id="semgrex_search" type="text" class="form-control" placeholder='e.g., {pos:/VB.*/} >nsubj {}=subject >/nmod:.*/ {}=prep_phrase'/>
        <span class="input-group-btn">
          <input id="button_semgrex" class="btn btn-default" type="submit" value="Match"/>
        </span>
        </div>
        </form>
      </div>

      <!-- Tregex -->
      <div class="tab-pane pattern_tab" id="div_tregex">
        <form id="form_tregex" accept-charset="UTF-8">
        <label for="tregex_search">Enter a <a href="http://nlp.stanford.edu/nlp/javadoc/javanlp/edu/stanford/nlp/trees/tregex/TregexPattern.html">Tregex</a>
          expression to run against the above sentence:</label>
        <div class="input-group">
          <input id="tregex_search" type="text" class="form-control" placeholder='e.g., NP < NN=animal'/>
        <span class="input-group-btn">
          <input id="button_tregex" class="btn btn-default" type="submit" value="Match"/>
        </span>
        </div>
        </form>
      </div>

    </div>
  </div>
</div>
</div>

<!-- The footer of the page -->
<footer id="footer" class="footer">
  <div class="container">
    <p class="text-muted">
      Visualisation provided using the <a href="http://brat.nlplab.org/">brat visualisation/annotation software</a>.
    </p>
  </div>
</footer>

</body>
